	.file	"output_udp.c"
	.text
	.type	reset_getopt, @function
reset_getopt:
.LFB2:
	.cfi_startproc
	pushl	%ebp
	.cfi_def_cfa_offset 8
	.cfi_offset 5, -8
	movl	%esp, %ebp
	.cfi_def_cfa_register 5
	movl	$0, optind
	popl	%ebp
	.cfi_restore 5
	.cfi_def_cfa 4, 4
	ret
	.cfi_endproc
.LFE2:
	.size	reset_getopt, .-reset_getopt
	.local	worker
	.comm	worker,4,4
	.local	command
	.comm	command,4,4
	.local	input_number
	.comm	input_number,4,4
	.local	addr
	.comm	addr,16,4
	.local	sd
	.comm	sd,4,4
	.local	bytes
	.comm	bytes,4,4
	.data
	.align 4
	.type	addr_len, @object
	.size	addr_len, 4
addr_len:
	.long	16
	.local	udpbuffer
	.comm	udpbuffer,1024,32
	.local	recvBuf
	.comm	recvBuf,1024,32
	.local	udp_client_a
	.comm	udp_client_a,16,4
	.local	currentConnectionsNum
	.comm	currentConnectionsNum,1,1
	.local	frame
	.comm	frame,4,4
	.local	frame_size
	.comm	frame_size,4,4
	.local	port
	.comm	port,4,4
	.section	.rodata
	.align 4
.LC0:
	.ascii	" -----------------------------------------------------------"
	.ascii	"----\n Help for output plugin..: UDP output plugin\n -------"
	.ascii	"----------------------------"
	.string	"----------------------------\n The following parameters can be passed to this plugin:\n\n [-p | --port ]..........: UDP port to listen for picture requests. UDP message is the filename to save\n\n ---------------------------------------------------------------\n"
	.text
	.globl	help
	.type	help, @function
help:
.LFB3:
	.cfi_startproc
	pushl	%ebp
	.cfi_def_cfa_offset 8
	.cfi_offset 5, -8
	movl	%esp, %ebp
	.cfi_def_cfa_register 5
	subl	$24, %esp
	movl	stderr, %eax
	movl	%eax, 12(%esp)
	movl	$402, 8(%esp)
	movl	$1, 4(%esp)
	movl	$.LC0, (%esp)
	call	fwrite
	leave
	.cfi_restore 5
	.cfi_def_cfa 4, 4
	ret
	.cfi_endproc
.LFE3:
	.size	help, .-help
	.section	.rodata
	.align 4
.LC1:
	.string	"cleaning up ressources allocated by worker thread\n"
	.text
	.globl	worker_cleanup
	.type	worker_cleanup, @function
worker_cleanup:
.LFB4:
	.cfi_startproc
	pushl	%ebp
	.cfi_def_cfa_offset 8
	.cfi_offset 5, -8
	movl	%esp, %ebp
	.cfi_def_cfa_register 5
	subl	$24, %esp
	movzbl	first_run.6275, %eax
	testb	%al, %al
	je	.L6
.L4:
	movb	$0, first_run.6275
	movl	stderr, %eax
	movl	%eax, 12(%esp)
	movl	$50, 8(%esp)
	movl	$1, 4(%esp)
	movl	$.LC1, (%esp)
	call	fwrite
	movl	frame, %eax
	testl	%eax, %eax
	je	.L3
	movl	frame, %eax
	movl	%eax, (%esp)
	call	free
	jmp	.L3
.L6:
	nop
.L3:
	leave
	.cfi_restore 5
	.cfi_def_cfa 4, 4
	ret
	.cfi_endproc
.LFE4:
	.size	worker_cleanup, .-worker_cleanup
	.section	.rodata
	.align 4
.LC2:
	.string	"a valid UDP port must be provided\n"
.LC3:
	.string	"bind"
	.text
	.type	Init_sock, @function
Init_sock:
.LFB5:
	.cfi_startproc
	pushl	%ebp
	.cfi_def_cfa_offset 8
	.cfi_offset 5, -8
	movl	%esp, %ebp
	.cfi_def_cfa_register 5
	subl	$24, %esp
	movl	port, %eax
	testl	%eax, %eax
	jg	.L8
	movl	stderr, %eax
	movl	%eax, 12(%esp)
	movl	$34, 8(%esp)
	movl	$1, 4(%esp)
	movl	$.LC2, (%esp)
	call	fwrite
	movl	$1, (%esp)
	call	exit
.L8:
	movl	$0, 8(%esp)
	movl	$2, 4(%esp)
	movl	$2, (%esp)
	call	socket
	movl	%eax, sd
	movl	$16, 4(%esp)
	movl	$addr, (%esp)
	call	bzero
	movw	$2, addr
	movl	$0, addr+4
	movl	port, %eax
	movzwl	%ax, %eax
	movl	%eax, (%esp)
	call	htons
	movw	%ax, addr+2
	movl	sd, %eax
	movl	$16, 8(%esp)
	movl	$addr, 4(%esp)
	movl	%eax, (%esp)
	call	bind
	testl	%eax, %eax
	je	.L7
	movl	$.LC3, (%esp)
	call	perror
.L7:
	leave
	.cfi_restore 5
	.cfi_def_cfa 4, 4
	ret
	.cfi_endproc
.LFE5:
	.size	Init_sock, .-Init_sock
	.type	SendFrame, @function
SendFrame:
.LFB6:
	.cfi_startproc
	pushl	%ebp
	.cfi_def_cfa_offset 8
	.cfi_offset 5, -8
	movl	%esp, %ebp
	.cfi_def_cfa_register 5
	subl	$56, %esp
	movl	frame, %eax
	movl	%eax, -12(%ebp)
	movl	$0, -16(%ebp)
	jmp	.L11
.L12:
	movl	sd, %eax
	movl	$16, 20(%esp)
	movl	$addr, 16(%esp)
	movl	$0, 12(%esp)
	movl	$1300, 8(%esp)
	movl	-12(%ebp), %edx
	movl	%edx, 4(%esp)
	movl	%eax, (%esp)
	call	sendto
	movl	%eax, -20(%ebp)
	movl	-20(%ebp), %eax
	addl	%eax, -12(%ebp)
	movl	-20(%ebp), %eax
	addl	%eax, -16(%ebp)
.L11:
	movl	frame_size, %eax
	cmpl	%eax, -16(%ebp)
	jb	.L12
	movl	$0, %eax
	leave
	.cfi_restore 5
	.cfi_def_cfa 4, 4
	ret
	.cfi_endproc
.LFE6:
	.size	SendFrame, .-SendFrame
	.section	.rodata
.LC4:
	.string	"not enough memory!!!\n"
	.text
	.globl	udp_thread
	.type	udp_thread, @function
udp_thread:
.LFB7:
	.cfi_startproc
	pushl	%ebp
	.cfi_def_cfa_offset 8
	.cfi_offset 5, -8
	movl	%esp, %ebp
	.cfi_def_cfa_register 5
	subl	$40, %esp
	jmp	.L15
.L18:
	movl	$global+4, (%esp)
	call	pthread_mutex_lock
	movl	$global+4, 4(%esp)
	movl	$global+28, (%esp)
	call	pthread_cond_wait
	movl	global+80, %eax
	movl	%eax, %edx
	movl	frame_size, %eax
	cmpl	%eax, %edx
	jbe	.L16
	movl	global+80, %eax
	addl	$30720, %eax
	movl	%eax, frame_size
	movl	$0, -12(%ebp)
	movl	frame_size, %edx
	movl	frame, %eax
	movl	%edx, 4(%esp)
	movl	%eax, (%esp)
	call	realloc
	movl	%eax, -12(%ebp)
	cmpl	$0, -12(%ebp)
	jne	.L17
	movl	$global+4, (%esp)
	call	pthread_mutex_unlock
	movl	stderr, %eax
	movl	%eax, 12(%esp)
	movl	$21, 8(%esp)
	movl	$1, 4(%esp)
	movl	$.LC4, (%esp)
	call	fwrite
	movl	$1, (%esp)
	call	exit
.L17:
	movl	-12(%ebp), %eax
	movl	%eax, frame
.L16:
	movl	global+80, %eax
	movl	%eax, %ecx
	movl	global+76, %edx
	movl	frame, %eax
	movl	%ecx, 8(%esp)
	movl	%edx, 4(%esp)
	movl	%eax, (%esp)
	call	memcpy
	movl	$global+4, (%esp)
	call	pthread_mutex_unlock
	movl	8(%ebp), %eax
	movl	%eax, (%esp)
	call	SendFrame
.L15:
	movl	global, %eax
	testl	%eax, %eax
	je	.L18
	movl	8(%ebp), %eax
	movl	%eax, (%esp)
	call	free
	leave
	.cfi_restore 5
	.cfi_def_cfa 4, 4
	ret
	.cfi_endproc
.LFE7:
	.size	udp_thread, .-udp_thread
	.section	.rodata
.LC5:
	.string	"touch the connections limits\n"
	.text
	.globl	worker_thread
	.type	worker_thread, @function
worker_thread:
.LFB8:
	.cfi_startproc
	pushl	%ebp
	.cfi_def_cfa_offset 8
	.cfi_offset 5, -8
	movl	%esp, %ebp
	.cfi_def_cfa_register 5
	subl	$104, %esp
	movl	$worker_cleanup, -12(%ebp)
	movl	$0, -16(%ebp)
	movl	$0, 4(%esp)
	leal	-72(%ebp), %eax
	movl	%eax, (%esp)
	call	__sigsetjmp
	movl	%eax, -20(%ebp)
	movl	-20(%ebp), %eax
	testl	%eax, %eax
	je	.L20
	movl	-16(%ebp), %eax
	movl	%eax, (%esp)
	movl	-12(%ebp), %eax
	call	*%eax
	leal	-72(%ebp), %eax
	call	__pthread_unwind_next
.L20:
	leal	-72(%ebp), %eax
	call	__pthread_register_cancel
	jmp	.L21
.L23:
	movl	sd, %eax
	movl	$addr_len, 20(%esp)
	movl	$addr, 16(%esp)
	movl	$0, 12(%esp)
	movl	$1024, 8(%esp)
	movl	$recvBuf, 4(%esp)
	movl	%eax, (%esp)
	call	recvfrom
	movl	%eax, bytes
	movzbl	currentConnectionsNum, %eax
	cmpb	$3, %al
	ja	.L22
	movl	$16, (%esp)
	call	malloc
	movl	%eax, -24(%ebp)
	movl	-24(%ebp), %eax
	movl	addr, %edx
	movl	%edx, (%eax)
	movl	addr+4, %edx
	movl	%edx, 4(%eax)
	movl	addr+8, %edx
	movl	%edx, 8(%eax)
	movl	addr+12, %edx
	movl	%edx, 12(%eax)
	movzbl	currentConnectionsNum, %eax
	movzbl	%al, %eax
	sall	$2, %eax
	leal	udp_client_a(%eax), %edx
	movl	-24(%ebp), %eax
	movl	%eax, 12(%esp)
	movl	$udp_thread, 8(%esp)
	movl	$0, 4(%esp)
	movl	%edx, (%esp)
	call	pthread_create
	movzbl	currentConnectionsNum, %eax
	addl	$1, %eax
	movb	%al, currentConnectionsNum
	jmp	.L21
.L22:
	movl	sd, %eax
	movl	$16, 20(%esp)
	movl	$addr, 16(%esp)
	movl	$0, 12(%esp)
	movl	$30, 8(%esp)
	movl	$.LC5, 4(%esp)
	movl	%eax, (%esp)
	call	sendto
.L21:
	movl	global, %eax
	testl	%eax, %eax
	je	.L23
	movl	port, %eax
	testl	%eax, %eax
	jle	.L24
	movl	sd, %eax
	movl	%eax, (%esp)
	call	close
.L24:
	leal	-72(%ebp), %eax
	call	__pthread_unregister_cancel
	movl	-16(%ebp), %eax
	movl	%eax, (%esp)
	movl	-12(%ebp), %eax
	call	*%eax
	movl	$0, %eax
	leave
	.cfi_restore 5
	.cfi_def_cfa 4, 4
	ret
	.cfi_endproc
.LFE8:
	.size	worker_thread, .-worker_thread
	.section	.rodata
.LC6:
	.string	"UDP output plugin"
.LC7:
	.string	" "
	.align 4
.LC8:
	.string	"ERROR: too many arguments to input plugin\n"
.LC9:
	.string	""
	.text
	.type	Parse_cmdLine, @function
Parse_cmdLine:
.LFB9:
	.cfi_startproc
	pushl	%ebp
	.cfi_def_cfa_offset 8
	.cfi_offset 5, -8
	movl	%esp, %ebp
	.cfi_def_cfa_register 5
	pushl	%edi
	pushl	%ebx
	subl	$192, %esp
	.cfi_offset 7, -12
	.cfi_offset 3, -16
	leal	-152(%ebp), %ebx
	movl	$0, %eax
	movl	$30, %edx
	movl	%ebx, %edi
	movl	%edx, %ecx
	rep stosl
	movl	$1, -16(%ebp)
	movl	$32, 4(%esp)
	movl	8(%ebp), %eax
	movl	%eax, (%esp)
	call	strchr
	movl	%eax, -20(%ebp)
	movl	$.LC6, -152(%ebp)
	cmpl	$0, -20(%ebp)
	je	.L27
	movl	-20(%ebp), %eax
	movzbl	(%eax), %eax
	testb	%al, %al
	je	.L27
	movl	$0, -24(%ebp)
	movl	$0, -156(%ebp)
	movl	$0, -28(%ebp)
	movl	-20(%ebp), %eax
	movl	%eax, (%esp)
	call	strdup
	movl	%eax, -24(%ebp)
	movl	$32, 4(%esp)
	movl	-24(%ebp), %eax
	movl	%eax, (%esp)
	call	strchr
	testl	%eax, %eax
	je	.L27
	leal	-156(%ebp), %eax
	movl	%eax, 8(%esp)
	movl	$.LC7, 4(%esp)
	movl	-24(%ebp), %eax
	movl	%eax, (%esp)
	call	strtok_r
	movl	%eax, -28(%ebp)
	cmpl	$0, -28(%ebp)
	je	.L27
	movl	-28(%ebp), %eax
	movl	%eax, (%esp)
	call	strdup
	movl	%eax, %edx
	movl	-16(%ebp), %eax
	movl	%edx, -152(%ebp,%eax,4)
	addl	$1, -16(%ebp)
	jmp	.L29
.L30:
	movl	-28(%ebp), %eax
	movl	%eax, (%esp)
	call	strdup
	movl	%eax, %edx
	movl	-16(%ebp), %eax
	movl	%edx, -152(%ebp,%eax,4)
	addl	$1, -16(%ebp)
	cmpl	$29, -16(%ebp)
	jle	.L29
	movl	stderr, %eax
	movl	%eax, 12(%esp)
	movl	$42, 8(%esp)
	movl	$1, 4(%esp)
	movl	$.LC8, (%esp)
	call	fwrite
	movl	$1, (%esp)
	call	exit
.L29:
	leal	-156(%ebp), %eax
	movl	%eax, 8(%esp)
	movl	$.LC7, 4(%esp)
	movl	$0, (%esp)
	call	strtok_r
	movl	%eax, -28(%ebp)
	cmpl	$0, -28(%ebp)
	jne	.L30
.L27:
	movl	$0, -12(%ebp)
	jmp	.L31
.L32:
	addl	$1, -12(%ebp)
.L31:
	movl	-12(%ebp), %eax
	cmpl	-16(%ebp), %eax
	jl	.L32
	call	reset_getopt
	jmp	.L39
.L40:
	nop
.L39:
	movl	$0, -160(%ebp)
	movl	$0, -32(%ebp)
	leal	-160(%ebp), %eax
	movl	%eax, 16(%esp)
	movl	$long_options.6324, 12(%esp)
	movl	$.LC9, 8(%esp)
	leal	-152(%ebp), %eax
	movl	%eax, 4(%esp)
	movl	-16(%ebp), %eax
	movl	%eax, (%esp)
	call	getopt_long_only
	movl	%eax, -32(%ebp)
	cmpl	$-1, -32(%ebp)
	je	.L26
	cmpl	$63, -32(%ebp)
	jne	.L34
	call	help
	movl	$1, (%esp)
	call	exit
.L34:
	movl	-160(%ebp), %eax
	cmpl	$5, %eax
	ja	.L40
	movl	$1, %edx
	movl	%edx, %ebx
	movl	%eax, %ecx
	sall	%cl, %ebx
	movl	%ebx, %eax
	movl	%eax, %edx
	andl	$48, %edx
	testl	%edx, %edx
	jne	.L38
	movl	%eax, %edx
	andl	$12, %edx
	testl	%edx, %edx
	jne	.L37
	andl	$3, %eax
	testl	%eax, %eax
	je	.L35
.L36:
	call	help
	movl	$0, (%esp)
	call	exit
.L37:
	movl	optarg, %eax
	movl	%eax, (%esp)
	call	strdup
	movl	%eax, command
	jmp	.L35
.L38:
	movl	optarg, %eax
	movl	%eax, (%esp)
	call	atoi
	movl	%eax, port
	nop
.L35:
	jmp	.L40
.L26:
	addl	$192, %esp
	popl	%ebx
	.cfi_restore 3
	popl	%edi
	.cfi_restore 7
	popl	%ebp
	.cfi_restore 5
	.cfi_def_cfa 4, 4
	ret
	.cfi_endproc
.LFE9:
	.size	Parse_cmdLine, .-Parse_cmdLine
	.globl	output_init
	.type	output_init, @function
output_init:
.LFB10:
	.cfi_startproc
	pushl	%ebp
	.cfi_def_cfa_offset 8
	.cfi_offset 5, -8
	movl	%esp, %ebp
	.cfi_def_cfa_register 5
	subl	$24, %esp
	movl	8(%ebp), %eax
	movl	%eax, (%esp)
	call	Parse_cmdLine
	call	Init_sock
	movl	$0, %eax
	leave
	.cfi_restore 5
	.cfi_def_cfa 4, 4
	ret
	.cfi_endproc
.LFE10:
	.size	output_init, .-output_init
	.globl	output_stop
	.type	output_stop, @function
output_stop:
.LFB11:
	.cfi_startproc
	pushl	%ebp
	.cfi_def_cfa_offset 8
	.cfi_offset 5, -8
	movl	%esp, %ebp
	.cfi_def_cfa_register 5
	subl	$24, %esp
	movl	worker, %eax
	movl	%eax, (%esp)
	call	pthread_cancel
	movl	$0, %eax
	leave
	.cfi_restore 5
	.cfi_def_cfa 4, 4
	ret
	.cfi_endproc
.LFE11:
	.size	output_stop, .-output_stop
	.globl	output_run
	.type	output_run, @function
output_run:
.LFB12:
	.cfi_startproc
	pushl	%ebp
	.cfi_def_cfa_offset 8
	.cfi_offset 5, -8
	movl	%esp, %ebp
	.cfi_def_cfa_register 5
	subl	$24, %esp
	movl	$0, 12(%esp)
	movl	$worker_thread, 8(%esp)
	movl	$0, 4(%esp)
	movl	$worker, (%esp)
	call	pthread_create
	movl	worker, %eax
	movl	%eax, (%esp)
	call	pthread_detach
	movl	$0, %eax
	leave
	.cfi_restore 5
	.cfi_def_cfa 4, 4
	ret
	.cfi_endproc
.LFE12:
	.size	output_run, .-output_run
	.section	.rodata
.LC10:
	.string	"h"
.LC11:
	.string	"help"
.LC12:
	.string	"c"
.LC13:
	.string	"command"
.LC14:
	.string	"p"
.LC15:
	.string	"port"
	.data
	.align 32
	.type	long_options.6324, @object
	.size	long_options.6324, 112
long_options.6324:
	.long	.LC10
	.long	0
	.long	0
	.long	0
	.long	.LC11
	.long	0
	.long	0
	.long	0
	.long	.LC12
	.long	1
	.long	0
	.long	0
	.long	.LC13
	.long	1
	.long	0
	.long	0
	.long	.LC14
	.long	1
	.long	0
	.long	0
	.long	.LC15
	.long	1
	.long	0
	.long	0
	.long	0
	.long	0
	.long	0
	.long	0
	.type	first_run.6275, @object
	.size	first_run.6275, 1
first_run.6275:
	.byte	1
	.weak	__pthread_unwind_next
	.ident	"GCC: (GNU) 4.7.2 20121109 (Red Hat 4.7.2-8)"
	.section	.note.GNU-stack,"",@progbits
